package com.dmcliver.timetracker.session;

import com.dmcliver.timetracker.entity.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.Arrays;

@Name("jobList")
public class JobList extends EntityQuery<Job> {

	private static final String EJBQL = "select job from Job job";

	private static final String[] RESTRICTIONS = { "lower(job.jobname) like lower(concat(#{jobList.job.jobname},'%'))", };

	private Job job = new Job();

	public JobList() {
		setEjbql(EJBQL);
		setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
		setMaxResults(25);
	}

	public Job getJob() {
		return job;
	}
}
